package com.team12.hotel404.service.serviceImpl;

import com.team12.hotel404.domain.Ropo;
import com.team12.hotel404.domain.RopoExample;
import com.team12.hotel404.mapper.RopoMapper;
import com.team12.hotel404.service.RolePowerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RolePowerServiceImpl implements RolePowerService {

    @Autowired
    private RopoMapper ropoMapper;

    /**
     * 列出所有的角色权限关系
     * @return
     */
    @Override
    public List<Ropo> listAllRolePower() {
        return ropoMapper.selectByExample(new RopoExample());
    }

    /**
     * 更新角色权限关系
     * @param ropo
     */
    @Override
    public void updateRolePowerInfo(Ropo ropo) {
        ropoMapper.updateByPrimaryKeySelective(ropo);
    }
}
